/*
 * DataChunk.java
 *
 * Created on May 1, 2007, 4:28 PM
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package org.plotnikov.pricemaker.utils;

import java.io.Serializable;

/**
 *
 * @author kostya
 */
public class DataChunk implements Serializable{
    
    private String id;
    private Object data;
    /** Creates a new instance of DataChunk */
    public DataChunk(String id, Object data) {
        this.id = id;
        this.data = data;
        if(data instanceof Number){
            this.data = new Long(((Number)data).longValue());
        }
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }

    public boolean equals(Object obj) {
        if(obj==null)
            return false;
        DataChunk ch = (DataChunk) obj;
        return ch.getId().equals(getId());
    }
    

}
